/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ControllerLayer.ControlServices.Recognizer;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;

/**
 *
 * @author Kovács Áron
 */
public class RecognizerTest {

     public static void main(String args[])
     {
         MainRecognizer rec = new MainRecognizer();

        ImageIcon icon = null;
        Image image = null;
        BufferedImage buffImageSample = null;
        BufferedImage buffImageAvg = null;

        System.out.println("ok");
        try
        {
            icon = new ImageIcon("E:\\avgs\\sample_l2.png");
            image = icon.getImage();
            // Create empty BufferedImage, sized to Image
            buffImageSample = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_RGB);
            // Draw Image into BufferedImage
            System.out.println("ok2");
            Graphics g = buffImageSample.getGraphics();
            g.drawImage(image, 0, 0, null);

            icon = new ImageIcon("E:\\avgs\\avg_l.png");
            image = icon.getImage();
            // Create empty BufferedImage, sized to Image
            buffImageAvg = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_RGB);
            // Draw Image into BufferedImage
            System.out.println("ok3");
            g = buffImageAvg.getGraphics();
            System.out.println("ok3.4");
            g.drawImage(image, 0, 0, null);
            System.out.println("ok4");

            System.out.println("ok");

        }
        catch(Exception ex)
        {
            System.out.print(ex);
        }


        System.out.println(rec.getDistance(buffImageSample, buffImageAvg));
     }
}
